public class Test {
    public static void main(String[] args) {
        int n=5;
        int count=0;
        while(n!=0){
            n=n&(n-1);
            count++;
        }
        System.out.println(count);
    }
    public static void main5(String[] args) {
        int a=36;
        int b=54;
        int c=b%a;
        while(c!=0){
            b=a;
            a=c;
            c=b%a;
        }
        System.out.println(a);
    }
    public static void main4(String[] args) {
        double sum=0;
        for (int i = 1; i <=100; i++) {
            sum+=1.0/i;
            sum=-sum;
        }
        System.out.println(sum);
    }
    public static void main3(String[] args) {
        int n=5;
        int i;
        for ( i = 2; i <=Math.sqrt(n); i++) {
            if(n%i==0){
                break;
            }
        }
        if(i>Math.sqrt(n)){
            System.out.println(n+"是一个素数");
        }
    }
    public static void main2(String[] args) {
        int a,b,c=0;
        int j=0;
        for (int i = 100; i <1000 ; i++) {
            j=i;
            a=j%10;j/=10;
            b=j%10;j/=10;
            c=j%10;j/=10;
            if(i==(a*a*a+b*b*b+c*c*c))
                System.out.println(i+"是一个"+"水仙花数。");
        }
    }
    public static void main1(String[] args) {
        int j=0;
        for (int i = 1; i <=100 ; i++) {
            if(i/10==9) {
                j++;
            }if (i%10==9) {
                j++;
            }
        }System.out.println(j);
    }
}